package com.shaw.workrecord.controller;

import com.shaw.workrecord.entity.ResponseBean;
import com.shaw.workrecord.pojo.response.CardResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class CardController {

    @GetMapping("/card")
    private ResponseBean<CardResponse> getRole(Integer index){
        List<String> list = getList();
        CardResponse cardResponse = new CardResponse();
        cardResponse.setId(index);
        cardResponse.setName(list.get(index-1));
        return ResponseBean.success(cardResponse);
    }

    public static final String common = "龙凤胎";
    public static final String bad = "双胞胎";

    private List<String> getList(){
        ArrayList<String> roleList = new ArrayList<>();
        roleList.add(common);
        roleList.add(bad);
        roleList.add(common);
        roleList.add(bad);
        roleList.add(common);
        roleList.add(common);
        return roleList;
    }

}
